package com.example.exercise.MysqlUtil;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class CheckMysqlConnect {

    static Connection conn = null;
    private static PreparedStatement ps=null;//操作整合sql语句的对象

    public static int getMainMysqlstate(){

        int result = 0;

        conn = Mysqlconnect.getConnection();
        try {
            if((conn!=null)&&(!conn.isClosed())){
                result =1;


            }
        } catch (Exception throwables) {
            throwables.printStackTrace();

        }

        Mysqlconnect.closeAll(conn,ps);
        return result;

    }



}
